<template>
    <div id="box">
        <div class="hd" :class="type == 3?'boxs':''">
            <div class="list" v-for="(item,index) in comTtile" :key="index">
                <div class="name" v-if="comTtile" :class="type == 3?'nameWidth':'nameWidths'">  <span class="garden" :style="{background: colors[index]}" ></span>  {{ comTtile[index] }}</div>
                <div class="count"v-if="comNumber" >{{comNumber[index] }}</div>
                <div class="proportion" v-if="comPercent"  >{{ comPercent[index]+'%' }}</div>
            </div>
        </div>
    </div>
</template>
   
<script setup>
import { ref,defineProps,onMounted } from 'vue';
const props = defineProps({
    comTtile:{
        type:Number
    },
    comNumber:{
        type:Number
    },
    comPercent:{
        type:Number
    },
    colors:{
        type:Number
    },
    type:{
        type:Number
    }
});
onMounted (() => {})





</script>
<style scoped lang="less">
.boxs{
    position: relative;
    right: 20px;
}
#box{ 
    display: flex;
    justify-content: center;
    position: relative;
    bottom: 15px;
    left: 25px;
}
.hd{

    border: 1px solid #074499;

}
.list{
    display: flex;
}

.nameWidth{
    width: 115px !important;
}
.list > div:first-child{
    padding-left: 10px !important;
    width: 80px ;
}
.list > div{
    text-align: center;
    width: 60px;
    height: 25px;
    border: 1px solid #074499;
    padding: 5px 0px;
    display: flex;
    justify-content: center;
    align-items: center;
  
    white-space: nowrap; /* 防止文本换行 */
   overflow: hidden; /* 隐藏超出容器的内容 */
   text-overflow: ellipsis; /* 当文本溢出时显示省略号 */
   justify-content: center;
}

#box > div > div{
    font-size: 14px;
    color: white;
    font-weight: 400;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    
}
.list:first-child{
    background: rgba(16, 28, 51, 1) !important;
}
.garden{
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
    top: 1px;
    margin-right: 5px;
}
deep .name:nth-child(1){
    width: 10px !important;
}
</style>